<template>
	<view v-if="resdata">
		<swiper :style="setSwiperH" indicator-dots autoplay :interval="3000" :duration="1000" circular>
			<swiper-item v-for="(item, i) in resdata" :key="i">
				<image :src="item.imgUrl" style="height: 375rpx;" @tap="swiperChange(item)"></image>
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
export default {
	props: {
		resdata: {
			type: Array,
			default: () => []
		},
		// swiper 组件的高度
		swiperH:{
			type:Number,
			default:()=>0
		}
	},
	onReady() {
	},
	computed:{
		setSwiperH(){
			const h = this.swiperH || 0
			return `height:${h}rpx;`
		}
	},
	methods:{
		swiperChange(item){
			console.log(item)
		}
	}
};
</script>

<style></style>
